package com.itheima.d3_transform_stream;

import java.io.*;

/**
 * 目标：掌握不同编码读取乱码的问题。
 */
public class Test1 {
    public static void main(String[] args) throws IOException {

        try (FileInputStream fr = new FileInputStream("day10io-app2/file/GBKFIle.txt");
             InputStreamReader isr = new InputStreamReader(fr, "GBK")) {
            int c;

            while ((c = isr.read()) != -1) {
                System.out.print((char) c);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
